
export interface FileExplorerInstance {
    highlightFile: (filePath: string, ignoreScroll: boolean) => Promise<void>
}

// 把文件浏览器实例保存起来，主要是用来操作完成后高亮
const fileExplorerInstances: { [key: string]: FileExplorerInstance } = {}

export const setFileExplorerInstance = (id: string, instance: FileExplorerInstance) => {
    fileExplorerInstances[id] = instance
}

export const getFileExplorerInstance = (id: string) => {
    return fileExplorerInstances[id]
}

export const removeFileExplorerInstance = (id: string) => {
    delete fileExplorerInstances[id]
}
